home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / perl5000.zip / perl5000 / pod / modpods / CheckTree.pod < prev    next >
Encoding:
Text File  |  1994-10-17  |  1.3 KB  |  38 lines

  1. =head1 NAME
  2.  
  3. validate - run many filetest checks on a tree
  4.  
  5. =head1 SYNOPSIS
  6.  
  7.     use File::CheckTree;
  8.  
  9.     $warnings += validate( q{
  10.     /vmunix                 -e || die
  11.     /boot                   -e || die
  12.     /bin                    cd
  13.         csh                 -ex
  14.         csh                 !-ug
  15.         sh                  -ex
  16.         sh                  !-ug
  17.     /usr                    -d || warn "What happened to $file?\n"
  18.     });
  19.  
  20. =head1 DESCRIPTION
  21.  
  22. The validate() routine takes a single multiline string consisting of
  23. lines containing a filename plus a file test to try on it.  (The
  24. file test may also be a "cd", causing subsequent relative filenames
  25. to be interpreted relative to that directory.)  After the file test
  26. you may put C<|| die> to make it a fatal error if the file test fails.
  27. The default is C<|| warn>.  The file test may optionally have a "!' prepended
  28. to test for the opposite condition.  If you do a cd and then list some
  29. relative filenames, you may want to indent them slightly for readability.
  30. If you supply your own die() or warn() message, you can use $file to
  31. interpolate the filename.
  32.  
  33. Filetests may be bunched:  "-rwx" tests for all of C<-r>, C<-w>, and C<-x>.
  34. Only the first failed test of the bunch will produce a warning.
  35.  
  36. The routine returns the number of warnings issued.
  37.  
  38.